package projectsys.sys.core.web.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import projectsys.sys.core.model.UserDetail;
import projectsys.sys.core.service.UserDetailManager;

@Controller
@RequestMapping("/userDetail")
public class UserDetailController extends BaseController{
	
	@Autowired
	UserDetailManager userDetailManager;
	
	@RequestMapping("/userDetailShow")
	public ModelAndView selectUserDetail(HttpServletRequest request) {
		ModelAndView mav = new ModelAndView("/showUser"); 
		Map<String, String> map = super.getParamValues(request);
		UserDetail userDetail = userDetailManager.getUserDetailByid(request.getParameter("id"));
		mav.addObject("userDetail", userDetail);
		mav.addObject("map", map);
		return mav;
	}
}
